
def change_packing(widget, expand=None, fill=None, padding=None,
                   pack_type=None):
    parent = widget.get_parent()
    packing = list(parent.query_child_packing(widget))

    if expand is not None:
        packing[0] = expand
    if fill is not None:
        packing[1] = fill
    if padding is not None:
        packing[2] = padding
    if pack_type is not None:
        packing[3] = pack_type

    parent.set_child_packing(widget, *tuple(packing))

